home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / tclx7_31.z / tclx7_31 / tcldev / tclX7.3a-p1 / tests / pushd.test < prev    next >
Encoding:
Text File  |  1994-01-23  |  1.5 KB  |  70 lines

  1. #
  2. # pushd.test
  3. #
  4. # Tests for tcl.tlib directory directory stack routines.
  5. #
  6. #---------------------------------------------------------------------------
  7. # Copyright 1992-1993 Karl Lehenbauer and Mark Diekhans.
  8. #
  9. # Permission to use, copy, modify, and distribute this software and its
  10. # documentation for any purpose and without fee is hereby granted, provided
  11. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  12. # Mark Diekhans make no representations about the suitability of this
  13. # software for any purpose.  It is provided "as is" without express or
  14. # implied warranty.
  15. #------------------------------------------------------------------------------
  16. # $Id: pushd.test,v 3.0 1993/11/19 06:58:00 markd Rel $
  17. #------------------------------------------------------------------------------
  18. #
  19.  
  20. if {[info procs test] == ""} then {source testlib.tcl}
  21. eval $SAVED_UNKNOWN
  22.  
  23. set CWD [pwd]
  24.  
  25. cd /tmp
  26.  
  27. #
  28. # Get actual location of /tmp incase its symbolicly linked.
  29. #
  30. set TMP [pwd]
  31.  
  32. Test pushd-1.1 {ppushd command} {
  33.     pushd
  34. } 0 {}
  35.  
  36. Test pushd-1.2 {pushd command} {
  37.     set dummy $TCLXENV(dirPushList)
  38. } 0 $TMP
  39.  
  40. Test pushd-1.3 {pushd command} {
  41.     pushd /
  42. } 0 {}
  43.  
  44. Test pushd-1.4 {pushd command} {
  45.     set TCLXENV(dirPushList)
  46. } 0 "$TMP $TMP"
  47.  
  48. cd $CWD
  49.  
  50. Test popd-1.1 {popd command} {
  51.     popd
  52. } 0 $TMP
  53.  
  54. Test popd-1.2 {popd command} {
  55.     set TCLXENV(dirPushList)
  56. } 0 $TMP
  57.  
  58. Test popd-1.3 {popd command} {
  59.     popd
  60.     popd
  61. } 1 {directory stack empty}
  62.  
  63. Test popd-1.4 {popd command} {
  64.     set TCLXENV(dirPushList)
  65. } 0 {}
  66.  
  67. cd $CWD
  68. rename unknown {}
  69.  
  70.